package src.com.doit.Demo04;

public class Person {
    private String name;
    private int age;
    public Person(){}//空参构造方法
    public Person(String name,int age)//带参构造方法(构造后,系统就不提供空参构造方法了)
    {
        this.name=name;
        this.age=age;
    }
    public void setName(String name)
    {
        this.name=name;
    }
    public void setAge(int age)
    {
        this.age=age;
    }

    public String getName() {
        return name;
    }
    public int getAge()
    {
        return age;
    }
    public void show()
    {
        System.out.println(name+age);
    }
}
